Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SwitchDataObject = exports.daoliuType = undefined;
var $2EventCenter = require("EventCenter");
var $2EventDefine = require("EventDefine");
var $2ObjUtil = require("ObjUtil");
var $2UIConfig = require("UIConfig");
(function (e) {
  e[e.taolu1 = 0] = "taolu1";
  e[e.taolu2 = 1] = "taolu2";
  e[e.taolu3 = 2] = "taolu3";
  e[e.taolu4 = 3] = "taolu4";
})(exports.daoliuType || (exports.daoliuType = {}));
var def_ServerConfig = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
    this.firstgame = false;
    this.gameconfig = {
      state: true,
      config: {
        newlist: [],
        hotlist: [],
        tipsanswer: [""],
        tuijian: [],
        sceneAlist: [],
        sceneBlist: [],
        sceneClist: [],
        sceneDlist: [],
        event_pointopen: ["level_win", "into_level", "level_use_business", "into_level_total", "adevent"],
        tt_event_pointopen: ["video", "putscore", "getscorelist", "getscore", "groupid", "groupid_new", "gameend"],
        banlist: ["guhuazhaocha_2152sNvYouDream", "guhuazhaocha_gunzhijia", "guhuazhaocha_kanjia_xLaoYSuoYi2188", "guhuazhaocha_bianxingji_cunkou", "guhuazhaocha_b_feipanglaoren", "guhuazhaocha_kanjia_xLaoYSuoYi2188", "guhuazhaocha_b_xuanyalaotou", "guhuazhaocha_bianxingji_sandaitongtang", "guhuazhaocha_b_shouhushunnv", "guhuazhaocha_kanjia_xJuHuiLao2175", "guhuazhaocha_kanjia_xingFuHome2168", "guhuazhaocha_font_kongchaolaoren", "guhuazhaocha_bianxingji_moriweiji", "guhuazhaocha_bianxingji_juanwang", "guhuazhaocha_bianxingji_guoquweilai_2", "guhuazhaocha_font_shiguangdejia", "guhuazhaocha_bianxingji_guoquheweilai", "guhuazhaocha_bianxingji_yeyenainai", "guhuazhaocha_bianxingji_woheyeye", "guhuazhaocha_kanjia_xGuangPan2222", "guhuazhaocha_kanjia_xGuiYiWanc2194", "guhuazhaocha_bianxingji_xiangwangSH", "guhuazhaocha_b_xuanyalaotou", "guhuazhaocha_kanjia_xingFuSunNv2183", "guhuazhaocha_gunzhijia", "guhuazhaocha_long_guonianbaojiaozi", "guhuazhaocha_bianxingji_cunkou", "guhuazhaocha_font_duandao"],
        rank: false,
        shangyehuaType: 0,
        sortinglist: [],
        sortinglist_atlas: [],
        sortinglist_find: [],
        enterscene: "主界面",
        sidebar_access: false,
        levelTiyan: false,
        needSecondReport: true,
        needReportEvent: true,
        isHadRenWu1: false,
        openInterstitial: true,
        openInterstitialtime: 60,
        showBanner: false,
        jiashidatas: [{
          levelname: "guhuazhaocha_font_biye",
          time: 60
        }],
        share: ""
      }
    };
    this.topapp = {
      apps: [],
      onlyapp: [],
      applist: []
    };
    this.video = null;
    this.IsHadData = false;
  }
  return babel_createClass(_ctor, [{
    key: "getNewApp",
    value: function getNewApp(e) {
      for (var _t42 = 0; _t42 < this.topapp.apps.length; _t42++) {
        if (this.topapp.apps[_t42].appId != e && !wx.clickedApp(this.topapp.apps[_t42].appId)) {
          return this.topapp.apps[_t42];
        }
      }
      return null;
    }
  }, {
    key: "init",
    value: function init(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
      if (e.gameconfig && e.gameconfig.config) {
        for (var _t43 in e.gameconfig) {
          if ($2ObjUtil.default.isObject(e.gameconfig[_t43])) {
            for (var _n41 in e.gameconfig[_t43]) {
              this.gameconfig[_t43][_n41] = e.gameconfig[_t43][_n41];
            }
          } else {
            this.gameconfig[_t43] = e.gameconfig[_t43];
          }
        }
        if (0 == t) {
          $2UIConfig.default.getInstance().init();
          cc.sys.localStorage.setItem("serverdata", JSON.stringify($2ObjUtil.default.clonJson(e)));
          $2EventCenter.default.postEvent($2EventDefine.default.EVENT_SERVERDATAENTER);
        }
      }
    }
  }, {
    key: "init2",
    value: function init2(e) {
      for (var _t44 in e) {
        if ($2ObjUtil.default.isObject(e[_t44])) {
          for (var _n42 in e[_t44]) {
            this.gameconfig.config[_t44][_n42] = e[_t44][_n42];
          }
        } else {
          this.gameconfig.config[_t44] = e[_t44];
        }
      }
      $2UIConfig.default.getInstance().init();
      cc.sys.localStorage.setItem("serverdata", JSON.stringify($2ObjUtil.default.clonJson(e)));
      $2EventCenter.default.postEvent($2EventDefine.default.EVENT_SERVERDATAENTER);
    }
  }], [{
    key: "getInstance",
    value: function getInstance() {
      if (null == this._instance) {
        this._instance = new _ctor();
        var _e39 = cc.sys.localStorage.getItem("serverdata");
        if (_e39 && "" != _e39) {
          _e39 = JSON.parse(_e39);
          this._instance.init(_e39, true);
        } else {
          this._instance.firstgame = true;
        }
      }
      return this._instance;
    }
  }]);
}();
exports.default = def_ServerConfig;
def_ServerConfig._instance = null;
exports.SwitchDataObject = /* */function () {
  function _class23() {
    babel_classCallCheck(this, _class23);
  }
  return babel_createClass(_class23);
}();